from django.contrib import admin
from django.contrib.admin import AdminSite
from django.contrib.auth.models import User
from survey.models import Survey, Question, AnswerSet
# Register your models here.

# class MyAdminSite(AdminSite):
#     site_header = "华广问卷管理后台"
#     index_title = "华广问卷"

# admin_site = MyAdminSite(name='myadmin')

class SurveyInLine(admin.StackedInline):
    model = Survey

class SurveyAdmin(admin.ModelAdmin):
    list_display = ['survey_id', 'survey_name', 'survey_status',
                    'created', 'updated', 'create_user',
                    'update_user']

class QuestionInLine(admin.StackedInline):
    model = Question

class QuestionAdmin(admin.ModelAdmin):
    list_display = ['qid', 'qtype', 'qtext', 'qnum', 'required', 'survey_id']

class AnswerSetInLine(admin.StackedInline):
    model = AnswerSet

class AnswerSetAdmin(admin.ModelAdmin):
    pass


admin.site.register(Survey, SurveyAdmin)
admin.site.register(Question, QuestionAdmin)
admin.site.register(AnswerSet, AnswerSetAdmin)
